Next | Prev | Up | Top | Contents | Index

Using the Texture Extension

To use the texture extension, call glTexImage1D() or glTexImage2D(), specifying one of the tokens defined by this extension as the components parameter.

Table 6-1 lists some of the formats defined by the extension; for a complete list, see
the reference page for glTexImage*(). The table shows the token names with their corresponding base formats and their desired component resolutions. It also shows Red (R), Green (G), Blue (B), Luminance (L), Alpha (A), and Intensity (I) values for each format. You can query the actual resolution with glGetTexLevelParameteriv() using
the appropriate token, such as GL_TEXTURE_RED_SIZE_EXT. All OpenGL implementations accept all tokens but may not always allocate a resolution exactly equal to that indicated in the table.

Some Internal Formats Supported by the Texture Extension
Token NameBase FormatRGBALI
GL_LUMINANCE8_EXTGL_LUMINANCE    8 
GL_LUMINANCE4_ALPHA4_EXTGL_LUMINANCE_ALPHA    44 
GL_LUMINANCE12_ALPHA4_EXT GL_LUMINANCE_ALPHA   412 
GL_LUMINANCE16_ALPHA16_EXT GL_LUMINANCE_ALPHA   1616 
GL_INTENSITY8_EXTGL_INTENSITY_EXT     8
GL_RGB4_EXTGL_RGB4 4 4   
GL_RGB8_EXTGL_RGB888   
GL_RGBA4_EXTGL_RGBA4444  
GL_RGB5_A1_EXTGL_RGBA5551  
GL_RGBA8_EXTGL_RGBA8888  

The extension redefines the application of a texture to the color components of a fragment. In particular, a new texture environment, GL_REPLACE_EXT, and two new texture formats, GL_ALPHA and GL_INTENSITY_EXT, are available. Table 6-2 illustrates this, with the abbreviations having the following meanings:

Rv, Gv, Bv, Av

result of the texture environment function

Rt, Gt, Bt, At

texture color

Rf, Gf, Bf, Af

fragment color

Rc, Gc, Bc, Ac

texture environment color (see GL_TEXTURE_ENV_COLOR)

Texture Functions
Base Texture FormatReplaceModulateBlendDecal
GL_
LUMINANCE
Rv = Lt

Gv = Lt

Bv = Lt

Av = Af

Rv = Rf * Lt

Gv = Gf * Lt

Bv = Bf * Lt

Av = Af

Rv = Rf * (1-Lt) + Rc* Lt

Gv = Gf * (1-Lt) + Gc * Lt

Bv = Bf * (1-Lt) + Bc * Lt

Av = Af

undefined
GL_ALPHARv = Rf

Gv = Gf

Bv = Gf

Av = At

Rv = Rf

Gv = Gf

Bv = Gf

Av = Af * At

Rv = Rf

Gv = Gf

Bv = Bf

Av = Af * At

undefined
GL_
INTENSITY_

EXT

Rv = It

Gv = It

Bv = It

Av = It

Rv = Rf * It

Gv = Gf * It

Bv = Bf * It

Av = Af * It

Rv = Rf * (1-It) + Rc * It

Gv = Gf * (1-It) + Gc * It

Bv = Bf * (1-It) + Bc * It

Av = Af * (1-It) + AcIt

undefined
GL_
LUMINANCE_ALPHA
Rv = Lt

Gv = Lt

Bv = Lt

Av = At

Rv = Rf * Lt

Gv = Gf * Lt

Bv = Bf * Lt

Av = Af * At

Rv = Rf * (1-Lt) + Rc * Lt

Gv = Gf * (1-Lt) + Gc * Lt

Bv = Bf * (1-Lt) + Bc * Lt

Av = Af * At

undefined
GL_RGBRv = Rt

Gv = Gt

Bv = Bt

Av = Af

Rv = Rf * Rt

Gv = Gf * Gt

Bv = Bf * Bt

Av = Af

Rv = Rf * (1-Rt) + Rc * Rt

Gv = Gf * (1-Gt) + Gc * Gt

Bv = Bf * (1-Bt) + Bc * Bt

Av = Af

Rv = Rt

Gv = Gt

Bv = Bt

Av = Af

GL_RBGARv = Rt

Gv = Gt

Bv = Bt

Av = At

Rv = Rf * Rt

Gv = Gf * Gt

Bv = Bf * Bt

Av = Af * At

Rv = Rf * (1-Rt) + Rc * Rt

Gv = Gf * (1-Gt) + Gc * Gt

Bv = Bf * (1-Bt) + Bc * Bt

Av = Af * At

Rv = Rf * (1-At) + Rt * At

Gv = Gf * (1-At) + Gt * At

Bv = Bf * (1-At) + Bt * At

Av = Af


Next | Prev | Up | Top | Contents | Index